<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <link href="js/jquery/jquery.uploadify-v2.1.0/uploadify.css"
              rel="stylesheet"
              type="text/css" />
        <link href="styles/default.css"
              rel="stylesheet"
              type="text/css"
              media="all">
        <script src="js/jquery/jquery-1.4.2.min.js"
        type="text/javascript"></script>
        <script type="text/javascript"
        src="js/jquery/jquery.uploadify-v2.1.0/swfobject.js"></script>
        <script type="text/javascript"
        src="js/jquery/jquery.uploadify-v2.1.0/jquery.uploadify.v2.1.0.min.js"></script>
        <script type="text/javascript"
        src="js/jquery/jquery.form.js"></script>
        <script>
            $(document).ready(function () {
                $("#uploadify").uploadify({
                    'uploader'       : 'js/jquery/jquery.uploadify-v2.1.0/uploadify.swf',
                    'script'         : 'src/upload.php',
                    'cancelImg'      : 'js/jquery/jquery.uploadify-v2.1.0/cancel.png',
                    'folder'         : 'db/uploads',
                    'queueID'        : 'fileQueue',
                    'auto'           : false,
                    'multi'          : true,
                    'checkScript'    : 'src/check.php',
                    'method'         : 'post',
                    'onAllComplete'  : function (event, data) {
                        alert("Number of Errors :: " + data.errors)
                    },
                    'onComplete'     : function (event, queueID, fileObj, response, data) {
                        alert(response);
                    }
                });
            });
            function submitForm () {
                //var queryString = '&' + $("#myForm").formSerialize();
                //alert(queryString);
                $("#uploadify").uploadifySettings('scriptData', {'name':'5', 'hello':'aa'});
                $("#uploadify").uploadifyUpload();
            }
        </script>
    </head>
    <body>
        <form id="myForm"
              action="comment.php"
              method="post">
            <p>
                Name:
                <input type="text"
                       name="name" />
            </p>
            <p>
                Comment:
                <textarea name="comment"></textarea>
            </p>
            <div id="fileQueue"></div>
            <input type="file"
                   name="uploadify"
                   id="uploadify" />
            <p><a href="javascript:$('#uploadify').uploadifyClearQueue()">Cancel All Uploads</a></p>
            <p>
                <input type="button"
                       value="Submit Comment"
                       onclick="submitForm()"/>
            </p>
        </form>
    </body>
</html>
